package com.softtown.modules.organization.dao;

import com.softtown.common.dao.BaseDao;
import com.softtown.modules.organization.entity.CompOrgEmplPosnEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: Dingyayong
 * @Date: 2019/6/22 09:16
 * @Description:
 */
@Mapper
public interface CompOrgEmplPosnDao extends BaseDao<CompOrgEmplPosnEntity> {

    /**
     * 查找员工岗位信息
     * @param compId
     * @param emplId
     * @return java.util.List<com.softtown.modules.organization.entity.CompOrgEmplPosnEntity>
     * @Author fuming
     * @Date 2020/5/26 15:40
     */
    List<CompOrgEmplPosnEntity> findListPosnEntity(@Param("compId") Long compId, @Param("emplId") Long emplId);

    /**
     * 更新
     *
     * @param compOrgEmplPosnEntity CompOrgEmplPosnEntity
     * @return
     * @author Dingyayong
     * @date 2019/6/22 9:46
     */
    boolean updateEmplPosn(CompOrgEmplPosnEntity compOrgEmplPosnEntity);

    /**
     * 根据员工ID和公司ID来查找员工岗位里的岗位ID
     * @param emplId
     * @param compId
     * @return java.util.List<java.lang.Long>
     * @Author fuming
     * @Date 2020/5/26 15:41
     */
    List<Long> getPosnIdByEmplIdAndCompId(@Param("emplId") Long emplId, @Param("compId") Long compId);

    /**
     * 根据员工ID和公司ID来查找员工岗位里的岗位名称
     * @param emplId
     * @param compId
     * @return java.util.List<java.lang.String>
     * @Author fuming
     * @Date 2020/5/26 15:41
     */
    List<String> getPosnNameByEmplIdAndCompId(@Param("emplId") Long emplId, @Param("compId") Long compId);

    /**
     * 根据参数查询员工和岗位
     * @param param
     * @param userId
     * @param compId
     * @param isSelf
     * @return java.util.List<com.softtown.modules.organization.entity.CompOrgEmplPosnEntity>
     * @Author fuming
     * @Date 2020/5/26 15:42
     */
    List<CompOrgEmplPosnEntity> selectAppoverPosnAndEmpl(@Param("param") String param, @Param("userId") Long userId,
                                                         @Param("compId") Long compId, @Param("isSelf") String isSelf);
}
